import java.util.Scanner;

public class demo04 {
    //四平方和
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int num=0;
        while (num*num<=n){
            num++;
        }
        for (int i = 0; i <= num; i++) {
            for (int j = 0; j <= num; j++) {
                for (int k = 0; k <= num; k++) {
                    for (int l = 0; l <= num; l++) {
                        if(l*l+k*k+j*j+i*i==n){
                            System.out.println(i+" "+j+" "+k+" "+l);
                            return;
                        }
                    }
                }
            }
        }
    }
}
